<?php echo $this->render('frontend_common/header.phtml'); ?>
<?php $this->headLink()->appendStylesheet($this->baseUrl('css/admintable.css')); ?>
<div>
<div id="Content" style="padding: 20px;width: 960px">
<div id="flower_tool">
	<a style="border: 1px solid red; background-color: white; border-radius:5px 5px 5px; padding:5px ;font-weight: bold;color: black;text-decoration: none " href="<?php echo $this->baseUrl('admin/addflower') ?>">Thêm giỏ hoa mới</a>
</div>

<table style="width: 100%; margin-top: 20px">
	<tr>
		<thead>
		<th>ID</th>
		<th>Hình ảnh</th>
		<th>Tên giỏ hoa</th>
		<th>Đơn giá bán</th>
		<th>Số lượng tồn</th>
		<th style="width: 100px">Tên file ảnh</th>
		<th></th>
		</thead>
	</tr>
<?php foreach ($this->giohoa as $key=>$motgiohoa) 
	{
	?>
	<tr
	<?php
			if ($key % 2 != 0)
				echo ('class="changecolor1" style="background-color:#f3f3f3;"');
			else
				echo ('class="changecolor2" style="background-color:#FFF;"');
		?>>
		<td><?php echo $motgiohoa['id']?></td>
		<td>
			<a href="<?php echo $this->baseUrl("images/".$motgiohoa['img_url']);?>" rel="lightbox">
				<img style="widht:60px; height:60px;" src="<?php echo $this->baseUrl("images/").$motgiohoa['img_url'] ?>">
			</a>
		</td>
		<td><?php echo $motgiohoa['tengiohoa'] ?></td>
		<td><?php echo $motgiohoa['dongiaban'] ?></td>
		<td><?php echo $motgiohoa['slton'] ?></td>
		<td><?php echo $motgiohoa['img_url'] ?></td>
		<td class="command">
			
			<?php
			if($motgiohoa['datrieng']==0){
				if($motgiohoa['flag']==1) {?>
				<a class="command" href="<?php echo $this->url(array('controller'=>'admin','action'=>'setflagflower','id_sp'=>$motgiohoa['id'])) ?>">
				<img title="Bỏ hiện ở Slide" src="<?php echo $this->baseUrl().'/images/system/down-btn.png' ?>" />
				</a>
			<?php } else { ?>
				<a class="command" href="<?php echo $this->url(array('controller'=>'admin','action'=>'setflagflower','id_sp'=>$motgiohoa['id'])) ?>">
				<img title="Đưa lên Slide" src="<?php echo $this->baseUrl().'/images/system/up-btn.png' ?>" />
				</a>
			<?php }?>
				<a class="command" href="<?php echo $this->baseUrl('admin/editflower/id_sp/').$motgiohoa['id'] ?>">
					<img title="Sửa thông tin" class="tool_img" src="<?php echo $this->baseUrl("images/system/changeicon.png") ?>" />
				 </a>
			<?php 
			}else 
				echo '<span style="color:red;font-size:13px">Được đặt riêng</span>';
			?>
			
			<a class="command" href="<?php echo $this->url(array('controller'=>'admin','action'=>'deleteflower','id_sp'=>$motgiohoa['id'])) ?>">
			 <img title="Xóa" class="tool_img" src="<?php echo $this->baseUrl("images/system/deleteicon.jpg") ?>" />
			 </a>
			 <a class="command" href="<?php echo $this->url(array('controller'=>'admin','action'=>'flowerdetail','id_sp'=>$motgiohoa['id'])) ?>">
			 <img title="Xem chi tiết" class="tool_img" alt="Sửa thông tin" src="<?php echo $this->baseUrl("images/system/detail.png") ?>" />
			 </a>
		</td>
	</tr>
<?php 
	}
?>
</table>
<a style="border: 1px solid red; background-color: white; border-radius:5px 5px 5px; padding:5px ;font-weight: bold;color: black;text-decoration: none; margin-top: 30px; float: left; " href="<?php echo $this->baseUrl('admin/index') ?>">Admin page</a>
<?php echo $this->render('frontend_common/footer.phtml'); ?>